home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F39108_zipWith.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-14  |  1.1 KB  |  33 lines

  1. <xsl:stylesheet version="1.0"
  2.  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  4. >
  5.   <xsl:template name="zipWith">
  6.     <xsl:param name="pFun" select="/.."/>
  7.     <xsl:param name="pList1" select="/.."/>
  8.     <xsl:param name="pList2" select="/.."/>
  9.     <xsl:param name="pElName" select="'el'"/>
  10.  
  11.     <xsl:if test="$pList1 and $pList2">
  12.       <xsl:variable name="vFunResult">
  13.         <xsl:apply-templates select="$pFun">
  14.           <xsl:with-param name="pArg1" select="$pList1[1]"/>
  15.           <xsl:with-param name="pArg2" select="$pList2[1]"/>
  16.         </xsl:apply-templates>
  17.       </xsl:variable>
  18.  
  19.       <xsl:element name="{$pElName}">
  20.         <xsl:copy-of select="$vFunResult"/>
  21.       </xsl:element>
  22.       
  23.       <xsl:call-template name="zipWith">
  24.         <xsl:with-param name="pFun" select="$pFun"/>
  25.         <xsl:with-param name="pList1" select="$pList1[position() > 1]"/>
  26.         <xsl:with-param name="pList2" select="$pList2[position() > 1]"/>
  27.         <xsl:with-param name="pElName" select="'el'"/>
  28.       </xsl:call-template>
  29.     </xsl:if>
  30.   </xsl:template>
  31. </xsl:stylesheet>
  32.  
  33.